package com.bite.springioc.Controller;

import com.bite.springioc.Model.UserInfo;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

@Controller
public class HelloController {
    @Autowired
    @Qualifier("user1")
    private UserInfo user;

    @Value("${myKey}")
    private String key;

    @Value("${myKey.value}")
    private String key2;

    @Value("${key.value1}")
    private String value1;
    @Value("${key.value2}")
    private String value2;

    //布尔型
    @Value("${boolean.value}")
    private Boolean hhh;

    public void sayHi(){
        System.out.println("do hello-----");
        System.out.println(user);
        System.out.println("读取到config：" + key);
        System.out.println("读取到config：" + key2);
        System.out.println("读取到config：" + value1);
        System.out.println("读取到config：" + value2);
        System.out.println("读取到config：" + hhh);
    }
}
